/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.pay.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author xxx
* @date 2025-03-28
**/
@Entity
@Data
@Table(name="BIS_JJZH_WX_PAY_ORDERS")
public class JjzhWxPayOrders implements Serializable {

    @Id
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @GeneratedValue(generator = "hibernate-uuid")
    @Column(name = "WX_PAY_ORDERS_ID")
    @ApiModelProperty(value = "订单ID")
    private String wxPayOrdersId;

    @Column(name = "BIS_ZHSQ_ID")
    @ApiModelProperty(value = "居家照护申请ID")
    private Long bisZhsqId;

    @Column(name = "SUB_MCHIND")
    @ApiModelProperty(value = "子商户号")
    private String subMchind;

    @Column(name = "ORDER_NO")
    @ApiModelProperty(value = "商户订单号")
    private String orderNo;


    @Column(name = "TRANSACTION_ID")
    @ApiModelProperty(value = "微信支付订单号")
    private String transactionId;

    @Column(name = "AMOUNT")
    @ApiModelProperty(value = "支付金额（单位：分）")
    private Long amount;

    @Column(name = "DESCRIPTION")
    @ApiModelProperty(value = "支付描述")
    private String description;

    @Column(name = "REFUND_REASON")
    @ApiModelProperty(value = "退款原因")
    private String refundReason;

    @Column(name = "BIS_ZHSQ_SNRY_XM")
    @ApiModelProperty(value = "姓名")
    private String bisZhsqSnryXm;

    @Column(name = "BIS_ZHSQ_SNRY_SFZ")
    @ApiModelProperty(value = "身份证")
    private String bisZhsqSnrySfz;

    @Column(name = "CURRENCY")
    @ApiModelProperty(value = "币种（默认人民币）")
    private String currency;

    @Column(name = "STATUS")
    @ApiModelProperty(value = "订单状态: 0下单成功,1支付成功,2退款")
    private Long status;

    @Column(name = "PAY_TIME")
    @ApiModelProperty(value = "支付时间")
    private Timestamp payTime;

    @Column(name = "REFUND_TIME")
    @ApiModelProperty(value = "退款时间")
    private Timestamp refundTime;

    @Column(name = "NOTIFY_DATA")
    @ApiModelProperty(value = "微信支付回调数据")
    private String notifyData;

    @Column(name = "REFUND_NOTIFY_DATA")
    @ApiModelProperty(value = "退款回调数据")
    private String refundNotifyData;

    @Column(name = "CREATED_AT")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createdAt;

    @Column(name = "UPDATED_AT")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updatedAt;

    @Column(name = "REFUND_ID")
    @ApiModelProperty(value = "退款订单号")
    private String refundId;

    @Column(name = "OUT_REFUND_NO")
    @ApiModelProperty(value = "商户退款单号")
    private String outRefundNo;

    @Column(name = "REMARKS")
    @ApiModelProperty(value = "备注")
    private String remarks;


    public void copy(JjzhWxPayOrders source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
